import javax.swing.JOptionPane;

public class HomeworkUsingJOptionPane {

	public static void main(String[] args) {

		String firstName = JOptionPane.showInputDialog("Enter First Name:");
		String surname = JOptionPane.showInputDialog("Enter Surname:");
		String ageAsString = JOptionPane.showInputDialog("Enter Age:");
		Integer ageAsNumber = Integer.parseInt(ageAsString);

		String oldGuyMessage = " i'm sorry but your really old.";
		String youngGuyMessage = " i'm happy to say that your still young.";
		String oldGuyMessageWithName = "";
		String youngGuyMessageWithName = "";

		if (ageAsNumber >= 40) {

			oldGuyMessageWithName = firstName + surname + oldGuyMessage;
			JOptionPane.showMessageDialog(null, oldGuyMessageWithName);

		}
		if (ageAsNumber < 40) {

			youngGuyMessageWithName = firstName + surname + youngGuyMessage;
			JOptionPane.showMessageDialog(null, youngGuyMessageWithName);

		}

	}

}
